<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="ISO-8859-1"%>
<%@include file="header.jsp" %><h3>Create a new Seed</h3>


                    <form action="SeedServlet">

                        <span class="error">
                            <%
                      String message = request.getParameter("msg");
                      if (message != null) {
                         out.println("<font color=red>");
                         if ("cname".equals(message)) {
                             out.println("Enter a valid common name");
                         } else if ("sname".equals(message)) {
                             out.println("Enter a valid scientific name");
                         } else if ("zone".equals(message)){
                             out.println("Enter a valid hardiness zone. This is between 0 and 12.");
                         } else if ("start".equals(message)){
                             out.println("enter valid start date");
                         } else if ("end".equals(message)){
                             out.println("enter valid end date");
                         } else if ("bad".equals(message)){
                             out.println("could not create seed");
                         }
                         out.println("</font>");
                       } 
                      
                      String cname="";
                      String sname="";
                      String reqs="";
                      String tips="";
                      String harvestInfo="";
                      if (cookies.length > 0) {
                      for (Cookie cookie : cookies) {
             if (cookie.getName().equals("cname")) {
                cname = cookie.getValue();
                 } if(cookie.getName().equals("sname")){
                sname=cookie.getValue();
                 } if(cookie.getName().equals("reqs")){
                     reqs=cookie.getValue();
                 } if(cookie.getName().equals("tips")){
                     tips=cookie.getValue();
                 } if(cookie.getName().equals("harvestInfo")){
                     harvestInfo=cookie.getValue();
                 }
                
            }}
                            %>
                        </span>
                        
                        <p><b>Common Name:</b> <input type="text" name="cname" value="<% out.println(cname); %>" /><br />
                            The seed's common name</p>
                        <p><b>Scientific Name:</b> <input type="text" name="sciname" value="<% out.println(sname); %>" /><br />
                            The seed's scientific name</p>
                        <p><b>Hardiness Zone Growing Region:</b> <select name="zoneregion">
                                <option value="0">0</option>
                                <option value="1">1</option>
                                <option value="2">2</option>
                                <option value="3">3</option>
                                <option value="4">4</option>
                                <option value="5">5</option>
                                <option value="6">6</option>
                                <option value="7">7</option>
                                <option value="8">8</option>
                                <option value="9">9</option>
                                <option value="10">10</option>
                                <option value="11">11</option>
                                <option value="12">12</option>
                            </select><br />
                            Your hardiness zone growing region</p>
                        <p><b>Special Requirements:</b> <input type="text" name="reqs" value="<% out.println(reqs); %>" /><br />
                            Any special requirements for growing the seed</p>
                        <p><b>Growing Tips:</b> <input type="text" name="tips" value="<% out.println(tips); %>" /><br/>
                            Tips for how to grow your seed!</p>
                        <p><b>Harvesting Information:</b> <input type="text" name="harvest" value="<% out.println(harvestInfo); %>" /><br/>
                            Information on harvesting.</p>
                        <p><b>Growing Season Available:</b> <br />
                            <select name="start">
                                <option value="January">January</option>
                                <option value="February">February</option>
                                <option value="March">March</option>
                                <option value="April">April</option>
                                <option value="May">May</option>
                                <option value="June">June</option>
                                <option value="July">July</option>
                                <option value="August">August</option>
                                <option value="September">September</option>
                                <option value="October">October</option>
                                <option value="November">November</option>
                                <option value="December">December</option>
                            </select> through 
                            <select name="end">
                                <option value="January">January</option>
                                <option value="February">February</option>
                                <option value="March">March</option>
                                <option value="April">April</option>
                                <option value="May">May</option>
                                <option value="June">June</option>
                                <option value="July">July</option>
                                <option value="August">August</option>
                                <option value="September">September</option>
                                <option value="October">October</option>
                                <option value="November">November</option>
                                <option value="December">December</option>
                            </select>
                            <br/>
                            The seed's growing system</p>

                        <input type="submit" value="create">
                    </form>
                    <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<%@include file="footer.html" %>